package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the SMPREGAD database table.
 * 
 */
@Embeddable
public class SmpregadPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long addressid;
	private long expuid;

    public SmpregadPK() {
    }

	@Column(unique=true, nullable=false)
	public long getAddressid() {
		return this.addressid;
	}
	public void setAddressid(long addressid) {
		this.addressid = addressid;
	}

	@Column(unique=true, nullable=false)
	public long getExpuid() {
		return this.expuid;
	}
	public void setExpuid(long expuid) {
		this.expuid = expuid;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof SmpregadPK)) {
			return false;
		}
		SmpregadPK castOther = (SmpregadPK)other;
		return 
			(this.addressid == castOther.addressid)
			&& (this.expuid == castOther.expuid);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.addressid ^ (this.addressid >>> 32)));
		hash = hash * prime + ((int) (this.expuid ^ (this.expuid >>> 32)));
		
		return hash;
    }
}